import xmmsclient
import xmmsqt4

def dbug_mess(name):
    print "[xmms2man] %s error!" % name

class Medialib:
    def __init__(self, xmms2):
        self.xmms2 = xmms2

    def get_id(self, url):
        def medialib_get_id_cb(res):
            if res.iserror():
                dbug_mess("get_id")
            else:
                id = res.value()
                return id

        self.xmms2.medialib_get_id(url, cb=medialib_get_id_cb)
